﻿using System.Data;

namespace Library.OrmEnterpriseEntity.TableInfo {
	/// <summary>
	/// Column information
	/// </summary>
	public interface IColumn : IColumnView {
		
		/// <summary>
		/// Get or set value of column
		/// </summary>
		object DbValue { get; set; }
		/// <summary>
		/// Write value from DB
		/// </summary>
		/// <param name="value"></param>
		void WriteFromDb(object value);
		/// <summary>
		/// Check current DBValue is difference between value stored in database
		/// </summary>
		bool ValueDbChange { get; }

		/// <summary>
		/// Validate
		/// </summary>
		/// <returns></returns>
		bool Validate();
		/// <summary>
		/// Table that column belong to
		/// </summary>
		DbTable Table { get; }
		/// <summary>
		/// Get culumn index in app, might be not the same DB column index
		/// </summary>
		int ColumnIndex { get; }
		
	}
}
